package com.ymk.service.impl;

import com.ymk.base.mybatis.DaoRouter;
import com.ymk.base.mybatis.Pagination;
import com.ymk.bo.mch.MchBO;
import com.ymk.service.IMchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 商户表 服务实现类
 * </p>
 *
 * @author 莫参商
 * @since 2023-05-11
 */
@Service
public class MchService implements IMchService {

    @Override
    public MchBO get(Map param) {
    return this.daoRouter.queryForObject("Mch.loadMch",param);
    }

    @Override
    public List<MchBO> list(Map param) {
        return this.daoRouter.query("Mch.loadMch",param);
    }

    @Override
    public List<MchBO> listForPage(Pagination pagination) {
        return this.daoRouter.query("Mch.loadMchForPage",pagination);
    }

    @Override
    public void post(MchBO param) {
        this.daoRouter.insert("AMch.insertMch",param);
    }

    @Override
    public void update(MchBO param) {
        this.daoRouter.update("AMch.updateMch",param);
    }

    @Override
    public void del(MchBO param) {
        this.daoRouter.update("AMch.delMch",param);
    }

    @Autowired
    private DaoRouter daoRouter;

}
